package com.smartbone.entity;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Stockinfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "stockinfo", catalog = "stockmaster", uniqueConstraints = @UniqueConstraint(columnNames = "stock"))
public class Stockinfo implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 3820327715533919117L;
	private Long id;
	private String stock;
	private String name;
	private Integer type;
	private Timestamp date;
	private Set<Collection> collections = new HashSet<Collection>(0);
	private Set<Band> bands = new HashSet<Band>(0);
	private Set<Stocktransaction> stocktransactions = new HashSet<Stocktransaction>(
			0);
	private Set<Finance> finances = new HashSet<Finance>(0);
	private Set<Recommend> recommends = new HashSet<Recommend>(0);
	private Set<Buysell> buysells = new HashSet<Buysell>(0);

	// Constructors

	/** default constructor */
	public Stockinfo() {
	}

	/** minimal constructor */
	public Stockinfo(String stock, String name, Integer type, Timestamp date) {
		this.stock = stock;
		this.name = name;
		this.type = type;
		this.date = date;
	}

	/** full constructor */
	public Stockinfo(String stock, String name, Integer type, Timestamp date,
			Set<Collection> collections, Set<Band> bands,
			Set<Stocktransaction> stocktransactions, Set<Finance> finances,
			Set<Recommend> recommends, Set<Buysell> buysells) {
		this.stock = stock;
		this.name = name;
		this.type = type;
		this.date = date;
		this.collections = collections;
		this.bands = bands;
		this.stocktransactions = stocktransactions;
		this.finances = finances;
		this.recommends = recommends;
		this.buysells = buysells;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "stock", unique = true, nullable = false, length = 10)
	public String getStock() {
		return this.stock;
	}

	public void setStock(String stock) {
		this.stock = stock;
	}

	@Column(name = "name", nullable = false, length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "type", nullable = false)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "date", nullable = false, length = 19)
	public Timestamp getDate() {
		return this.date;
	}

	public void setDate(Timestamp date) {
		this.date = date;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "stockinfo")
	public Set<Collection> getCollections() {
		return this.collections;
	}

	public void setCollections(Set<Collection> collections) {
		this.collections = collections;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "stockinfo")
	public Set<Band> getBands() {
		return this.bands;
	}

	public void setBands(Set<Band> bands) {
		this.bands = bands;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "stockinfo")
	public Set<Stocktransaction> getStocktransactions() {
		return this.stocktransactions;
	}

	public void setStocktransactions(Set<Stocktransaction> stocktransactions) {
		this.stocktransactions = stocktransactions;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "stockinfo")
	public Set<Finance> getFinances() {
		return this.finances;
	}

	public void setFinances(Set<Finance> finances) {
		this.finances = finances;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "stockinfo")
	public Set<Recommend> getRecommends() {
		return this.recommends;
	}

	public void setRecommends(Set<Recommend> recommends) {
		this.recommends = recommends;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "stockinfo")
	public Set<Buysell> getBuysells() {
		return this.buysells;
	}

	public void setBuysells(Set<Buysell> buysells) {
		this.buysells = buysells;
	}

}